package com.xtu.hrms.dao;

import com.xtu.hrms.bean.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author : FeiYu Hao
 * @date : 2023/4/29 18:13
 * @modyified By :
 */
@Repository//dao层注解
public class EmployeeDao {
    //    模拟数据库中的数据，表用集合来存储
    private static Map<Integer, Emp> employees = null;

    //static是优先加载的，加载完了才初始化成员变量，所以它不能通过get方法拿到department里面的内容
    static {
        employees = new HashMap<Integer, Emp>();
        employees.put(1,new Emp(1,"李一",25,"男","15452135844","河南工程学院","sdf4215","本科"));
        employees.put(2,new Emp(2,"李二",36,"男","15546464466","河南工业大学","sdf7425","硕士"));
        employees.put(3,new Emp(3,"李三",28,"女","14764665357","河南理工大学","sdf4217","硕士"));
        employees.put(4,new Emp(4,"王五",30,"男","14245646535","信阳师范学院","sdf4215","本科"));
        employees.put(5,new Emp(5,"李红艳",28,"女","14764655357","河南师范大学","sdf4315","硕士"));
        employees.put(6,new Emp(6,"马云",32,"男","14762134655","南阳师范学院","sdf4219","本科"));
        employees.put(7,new Emp(7,"百度",26,"女","14762135456","郑州经贸学院","sdf5215","专科"));
        employees.put(8,new Emp(8,"李四",22,"女","14762135346","安阳师范学院","sdf4265","硕士"));
        employees.put(9,new Emp(9,"李一",25,"男","15452135844","河南工学院","sdf4265","专科"));
        employees.put(10,new Emp(10,"王飞",36,"男","16546464412","河南大学","sdf7466","博士"));
        employees.put(11,new Emp(11,"王研",28,"女","14764665111","河南大学","sdf4277","博士"));
        employees.put(12,new Emp(12,"王期",30,"男","14226465357","信阳师范学院","sdf4288","硕士"));
        employees.put(13,new Emp(13,"李红",28,"女","14776553575","河南师范大学","sdf6615","硕士"));
        employees.put(14,new Emp(14,"马报国",22,"男","14862134655","南阳师范学院","sdf6219","硕士"));
        employees.put(15,new Emp(15,"黄三",29,"女","14764665112","河南大学","sdf1277","博士"));
        employees.put(16,new Emp(16,"王武",30,"男","14326465357","信阳师范学院","sdf1288","硕士"));
        employees.put(17,new Emp(17,"李酒",38,"女","14976553575","河南师范大学","sdf1615","本科"));
        employees.put(18,new Emp(18,"刘报国",23,"男","14662134655","南阳师范学院","sdf1219","硕士"));
        employees.put(19,new Emp(19,"李委",25,"男","15452135845","河南工程学院","sdf9215","本科"));
        employees.put(20,new Emp(20,"李中",36,"男","15546464467","河南工业大学","sdf9425","硕士"));
        employees.put(21,new Emp(21,"李久",28,"女","14764665358","河南理工大学","sdf9217","硕士"));
        employees.put(22,new Emp(22,"王宝川",30,"男","14245646545","信阳师范学院","sdf9215","本科"));
        employees.put(23,new Emp(23,"李严艳",25,"女","14764655367","河南师范大学","sdf9315","硕士"));











    }
    //    查询全部员工信息
    public Collection<Emp> getAllEmp(){
        return employees.values();
    }
}
